package com.gl.multipleyes.api

import grails.converters.JSON
import grails.plugin.facebooksdk.FacebookGraphClient
import grails.transaction.Transactional

import com.gl.multipleyes.User
import com.gl.multipleyes.Usie

class UsieController extends MultipleyesController {
	
	static namespace = "api"
	
	def index(){
		render "Hola Mundo Papa"	
	}
	
	@Transactional
	def save(Usie usieInstance){
		println "saving"
		def resp = checkedOperation {
			usieInstance.usieMaster = params.user as User
			usieInstance.save(flush:true, failOnError:true)
			return usieInstance
		}
		render resp as JSON
	}
	
}
